<head>
  <meta name="layout" content="main" />
  <title>Atualizar Cadastro</title>
  <link rel="stylesheet" href="${createLinkTo(dir:'css',file:'datarel.css')}" />
  <g:javascript library="jquery"/>

    <script language="javascript">


      var verifica = function(){
                                       if($('#passwd').val() == '123'){
                                                    $('#passwd').val('')
                                                    alert ('Não é Permitido a Senha 123')
                                                    $('#passwd').focus();
                                                      

                                                }
                                       
                                             };



  </script>
</head>
<body>
  <div class="body">
    <h1>Atualizar cadastro</h1>
    <g:if test="${flash.message}">
      <div class="message">${flash.message}</div>
    </g:if>
    <g:hasErrors bean="${person}">
      <div class="errors">
        <g:renderErrors bean="${person}" as="list" />
      </div>
    </g:hasErrors>
    <g:form>
      <input type="hidden" name="id" value="${person.id}" />
      <input type="hidden" name="version" value="${person.version}" />
        <div Style ="display:none;">





 





         <g:if test="${person.userRealName ==  'TEMP'}">

        <div class="col_3">
          <label for="oldPass">Senha Antiga:</label>
          <input type="password"
                 class="textfield full-me"
                 id="oldPass" name="oldPass"
                 value="123"
                 readonly/>
        </div>

         </g:if>

        <g:else>
          <div class="col_4">
          <label for="oldPass">Senha Antiga:</label>
          <input type="password"
                 class="textfield full-me"
                 id="oldPass" name="oldPass"
                 value="${null}" />
        </div>



        </g:else>






      </div>

       <div class ="row">

        <div class="col_4">
          <label for="passwd">Senha Nova: </label>
          <input type="password" onchange ="verifica();"
                 class="textfield full-me"
                 id="passwd" name="passwd"
                 />
        </div>


      </div>




    




      <div class ="row">

        <div class="col_4">
          <label for="passwd">Redigite &agrave; Senha Nova:</label>
          <input type="password"
                 class="textfield full-me"
                 id="passwd2" name="passwd2" />
        </div>


      </div>
 







          <div class="clear"><!-- clear --></div>
        </div>
      </div>

  </div>
      <div class="clear"><!-- clear --></div>
      <div class="row">
        <div class="col_2">
          <g:actionSubmit action="updatePass"
          value="Atualizar" class="cmdsave full-me"/>
        </div>

      </div>

        </g:form>

</body>
